var t = getApp();

Page({
    data: {
        language: "",
        first_content: [],
        second_content: [],
        third_content: [],
        fourth_content: [],
        activeName: "first",
        show: !0,
        orderData: [],
        time_type: "",
        active: 0,
        is_first_content: !1,
        is_second_content: !1,
        is_third_content: !1,
        is_fourth_content: !1,
        currentTabIndex: "0"
    },
    onLoad: function(t) {
        t.date && (this.setData({
            time_type: t.date
        }), this.setDataByTabIndex());
    },
    onReady: function() {
        var t = wx.getStorageSync("langIndex");
        this.setData({
            language: t.en
        });
    },
    toInfo: function(t) {
        console.log(t);
        var a = t.currentTarget.dataset.id;
        wx.navigateTo({
            url: "/packageC/microshop/shareDetail/shareDetail?id=" + a
        });
    },
    onShow: function() {},
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {},
    onShareAppMessage: function() {},
    setDataByTabIndex: function() {
        "0" != this.data.currentTabIndex || this.data.is_first_content ? "1" != this.data.currentTabIndex || this.data.is_second_content ? "2" != this.data.currentTabIndex || this.data.is_third_content ? "3" != this.data.currentTabIndex || this.data.is_fourth_content || (this.setData({
            is_fourth_content: !0
        }), this.getData("-1")) : (this.setData({
            is_third_content: !0
        }), this.getData("1")) : (this.setData({
            is_second_content: !0
        }), this.getData("0")) : (this.setData({
            is_first_content: !0
        }), this.getData(""));
    },
    getData: function(a) {
        var n = this, e = t.getNetAddresss("plugin.micro.frontend.controllers.MicroShopBonusLog.list.apply");
        e += "&apply_status=" + a, e += "&time_type=" + this.data.time_type, t._getNetWork({
            url: e,
            success: function(t) {
                var a = t.data;
                1 == a.result && ("0" == n.data.currentTabIndex ? n.setData({
                    first_content: a.data.list.data
                }) : "1" == n.data.currentTabIndex ? n.setData({
                    second_content: a.data.list.data
                }) : "2" == n.data.currentTabIndex ? n.setData({
                    third_content: a.data.list.data
                }) : "3" == n.data.currentTabIndex && n.setData({
                    fourth_content: a.data.list.data
                }));
            },
            fail: function(t) {
                console.log(t);
            }
        });
    },
    handleClick: function(t) {
        var a = t.detail.index;
        this.data.currentTabIndex != a && (this.setData({
            currentTabIndex: a
        }), this.setDataByTabIndex());
    }
});